function diff = grid_ini_fun( A, c, n, ind)
    % create grid 
    a = A(1);
    b = A(2);
    v = (exp( c.*linspace(0,1,n))-1)./(exp( c)-1);
    if ind == 1
        diff = a + (b-a).*v;
    elseif ind == -1
        v=flip(v);
        diff = b + (a-b).*v;       
    end        
end